package com.guigu.xm.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class GoodsId {
    private Long productId;

    public Long addId(){
        if(productId==null){
            Date date = new Date();
            int year = date.getYear();
            int date1 = date.getDate();
            int month = date.getMonth();
            String ss=year+""+month+""+date1+"0001";
            productId=Long.parseLong(ss);
        }
        return productId+=1;
    }
}